<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />		
		<meta content="yes" name="apple-mobile-web-app-capable"> 
		<meta content="yes" name="apple-touch-fullscreen"> 
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<meta charset="UTF-8">
		<title>注册</title>
		<link rel="stylesheet" type="text/css" href="css/swiper.min.css" />
		<link href="css/mui.min.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" type="text/css" href="css/mui.min.css">
		<script type="text/javascript" src="js/flexible.js"></script>
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<link rel="stylesheet" type="text/css" href="css/style.css">
<style>
	.login-form {
		width: 100%;
	}

	.login-form .login-input {
		margin: 0 auto;
	}

	.login-form .login-button {
		width:10rem;
		margin: 0 auto;
	}
</style>
	</head>
	<body>
		<div class="fjx"></div>
		<form class="login-form">
		   <div class="login-input">
		   		<input type="text" placeholder="用户名" name="">
		   </div>
		   <div class="login-input" >
		   		<input type="text" style="width:6.533rem;" class="fl" id="phone" placeholder="输入手机号" name="">
		   		<!--<a href="javascript:;" class="fr" id="get_code_btn">获取验证码</a>-->
		   </div>
		    <!--<div class="login-input" id="code" >-->
		   		<!--<input type="text" placeholder="验证码" name="">-->
		   <!--</div>-->

		    <div class="login-input">
		   		<input type="password" placeholder="请输入6~18位密码" name="">
		   </div>
		    <div class="login-input">
		   		<input type="password" placeholder="重复密码" name="">
		   </div>
			<div class="login-button">
				<input type="button" style="height:1.133rem;margin-top:1.173rem;" value="注册" class="content-but"/>
			</div>
		</form>
		
	</body>
	<script type="text/javascript" src="js/vue.js"></script>
	<script type="text/javascript" src="js/swiper.jquery.min.js"></script>
	<script>
        var sends = {
            checked:1,
            send:function(){
                var numbers = /^1\d{10}$/;
                var val = $('#phone').val().replace(/\s+/g,""); //获取输入手机号码
                if($('.div-phone').find('span').length == 0 && $('.div-phone a').attr('class') == 'send1'){
                    if(!numbers.test(val) || val.length ==0){
                        $('.div-phone').append('<span class="error">手机格式错误</span>');
                        return false;
                    }
                }
                if(numbers.test(val)){
                    var time = 30;
                    $('.div-phone span').remove();
                    function timeCountDown(){
                        if(time==0){
                            clearInterval(timer);
                            $('.div-phone a').addClass('send1').removeClass('send0').html("发送验证码");
                            sends.checked = 1;
                            return true;
                        }
                        $('.div-phone a').html(time+"S后再次发送");
                        time--;
                        return false;
                        sends.checked = 0;
                    }
                    $('.div-phone a').addClass('send0').removeClass('send1');
                    timeCountDown();
                    var timer = setInterval(timeCountDown,1000);
                }
            }
        }
	</script>
	<script type="text/javascript">
        $('#get_code_btn').click(function(){
            var phone = $('#phone').val();  //获取输入的手机号码
            if(!$("#get_code_btn").hasClass('fr')){  //判断是否有这个class名字
                $.Dialog.loading();
                var reg_phone = /1\d{10}/;
                if(!reg_phone.test(phone)){   //验证手机是否符合格式
                    $.Dialog.fail("填写手机号");
                    return false;
                }
                // $.post(get_code_url,{phone:phone},  //发起请求
                //     function(data){
                //     alert("123w")
                //         if(data.result==1){
                //             $.Dialog.success("发送成功");
                //             var leftTime = 60;
                //             var timer = setInterval(function(){  //倒计时
                //                 $('#get_code_btn').text(leftTime+'秒');
                //                 leftTime&#45;&#45;;
                //                 if(leftTime==0){ //重新发送
                //                     clearInterval(timer);
                //                     $('#get_code_btn').text('重新获取');
				//
                //                 }
                //             },1000);
                //         }else{
                //             $('#get_code_btn').text('重新获取');
				//
                //             alert(data.msg);
                //             $.Dialog.close();
                //             //$.Dialog.fail(data.msg);
                //         }
                //     }
                // ).error(
                //     function(){ //发送失败
                //         $('#get_code_btn').text('重新获取');
                //         $.Dialog.fail("系统繁忙");
                //     }
                // );
            }
        });
	</script>

</html>
